<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp" %>
<html>
 <head>
    <title>仓库信息管理</title>
    <!-- import css and js -->
	<%@ include file="/common/meta.jsp" %>
	<script src="${ctx}/js/ligerUI/js/plugins/ligerLayout.js" type="text/javascript"></script>
	<script src="${ctx}/js/jsp/comm.js" type="text/javascript"></script>
	<script type="text/javascript">
		var basic_Url="${ctx}/public/windowalert";
		function createSearch(){
			init(2,8,'100,100,100,100,100,100','10%');
			//第一行的数据
			addCommon(0,0,"lable","物料编码：");
			addCommon(0,1,"txtlike","zd004MaterialsCode");
			addCommon(0,2,"lable","物料名称：");
			addCommon(0,3,"txtlike","zd005MaterialsName");
			addCommon(0,4,"lable","型号：");
			addCommon(0,5,"txtlike","zd007MaterialsModel");
			addCommon(0,6,"lable","pi编号：");
			addCommon(0,7,"txtlike","zd026PiCode");
			addCommon(1,0,"lable","物料规格：");
			addCommon(1,1,"txtlike","zd006MaterialsSpec");
			addCommon(1,2,"lable","物料颜色：");
			addCommon(1,3,"txtlike","zd008MaterialsColor");
			addCommon(1,4,"lable","物料材质：");
			addCommon(1,5,"txtlike","zd008MaterialsQuanlity");
			addCommon(1,6,"lable","客户名称：");
			addCommon(1,7,"txtlike","zd028CustomerName");
		}
		
		function searchAP(){
			multipleSearch("#table1",true,"",basic_Url+"/itemafflist.do?code=${code}");
		}
		var grid;
		$(function(){
				grid = $("#table1").ligerGrid({
		        columns: [
						  { display: 'id', name: 'id',hide : 1, width: 1},
						  { display: 'bmid', name: 'zd003MaterialsId',hide : 1, width: 1},
						  { display: '仓库', name: 'zd001WhName', width: 110 },
						  { display: '物料类型',hide : true, name: 'maType', width: 100 },
		                  { display: '仓库编码',hide : true, name: 'zd001WhCode', width: 1 },
		                  { display: '物料编码', name: 'zd004MaterialsCode', width: 145 },
		                  { display: '物料名称', name: 'zd005MaterialsName', width: 145 },
		                  { display: '型号', name: 'zd007MaterialsModel', width: 100 },
		                  { display: '规格', name: 'zd006MaterialsSpec', width: 100 },
		                  { display: '颜色', name: 'zd008MaterialsColor', width: 100},
		                  { display: '材质', name: 'zd008MaterialsQuanlity', width: 100},
		                  { display: '单位', name: 'zd008Unit', width: 60 },
		                  { display: 'pi编号', name: 'zd026PiCode', width: 100 },
		                  { display: '客户名称', name: 'zd028CustomerName', width: 150 },
		                  { display: '库存数量', name: 'zd009Quantity', width: 60 ,render : function(row){
		                	  if(row.zd009Quantity == null || row.zd009Quantity == ''){
		                		  return '0.0';
		                	  }
		                	  return row.zd009Quantity;
		                  }}/* ,
		                  { display: '一等数量', name: 'zd019OneQuantity', width: 60 ,render : function(row){
		                	  if(row.zd019OneQuantity == null || row.zd019OneQuantity == ''){
		                		  return '0.0';
		                	  }
		                	  return row.zd019OneQuantity;
		                  }},
		                  { display: '次品数量', name: 'zd016DefectiveQuantity', width: 60 ,render : function(row){
		                	  if(row.zd016DefectiveQuantity == null || row.zd016DefectiveQuantity == ''){
		                		  return '0.0';
		                	  }
		                	  return row.zd016DefectiveQuantity;
		                  }},
		                  { display: '旧件数量', name: 'zd016DefectiveQuantity', width: 60 ,render : function(row){
		                	  if(row.zd016DefectiveQuantity == null || row.zd016DefectiveQuantity == ''){
		                		  return '0.0';
		                	  }
		                	  return row.zd016DefectiveQuantity;
		                  }},
		                  { display: '冻结数量', name: 'zd010BlockedStockQuantity', width: 60 ,render : function(row){
		                	  if(row.zd010BlockedStockQuantity == null || row.zd010BlockedStockQuantity == ''){
		                		  return '0.0';
		                	  }
		                	  return row.zd010BlockedStockQuantity;
		                  }},
		                  { display: '在途数量', name: 'zd011TravelingQuantity', width: 60 ,render : function(row){
		                	  if(row.zd011TravelingQuantity == null || row.zd011TravelingQuantity == ''){
		                		  return '0.0';
		                	  }
		                	  return row.zd011TravelingQuantity;
		                  }} */
		                      ],  usePager: true,pageSize:30,
		                      url : basic_Url+"/itemafflist.do?code=${code}",
		                      width: "100%", height:"98%", checkbox: true
		                  });
			$("#pageloading").hide();
		})
		
		function getSelected(){
			var rows = grid.getCheckedRows();
			 return rows;
		}
		
		function Close(){
			CloseDialog();
		}
		//按回车 ，查询
		document.onkeydown=keyListener;   
		function keyListener(e){   
		    e = e ? e : event;  
		    if(e.keyCode == 13){   
		    	searchAP();
		    }   
		}  
	</script>
	
  </head>
 <body style="padding:10px" onLoad="createSearch()">  
       <div id="layout1">
          <div id="pageHeader" class="pageHeader">
               <div class="searchBar" id="multipleSearchDialog">
	                <table class="table" width="100%" id="searchHeader" >  
                        <tbody id="newbody">
                        </tbody>
 	                </table>
                    <div class="subBar">
			             <ul>
				             <li><div class="buttonActive"><div class="buttonContent"><button type="submit" id="btnSearch" onclick="searchAP()">查询</button></div></div></li>
				             <li><a class="button" onclick="clearSearch()"><span>重置</span></a></li>
			             </ul>
	                </div>
               </div>
          </div>
      </div>
      <div position="center" id="table1">
      </div>
      <div class="clear"></div>
   </div>
    </body>
</html>